<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Models\FactoryStatistical;
use App\Models\RepairerStatistical;

class ResetStatistical extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'reset:statistical';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '重置所有当天的统计计数';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        // 厂家当日订单处理数清零
        FactoryStatistical::update(['today_handle_order_count'=>0]);
        // 施工方今日安装量清零
        RepairerStatistical::update(['today_install_count'=>0]);
    }
}
